import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询店员申请列表
export function listUser(data) {
  return request({
    url: '/employee/apply/employeeApplyList',
    method: 'post',
    data: data
  })
}

// 查询店员申请详细
export function getUser(userId) {
  return request({
    url: '/employee/apply/' + parseStrEmpty(userId),
    method: 'get'
  })
}

// 修改店员申请
export function updateUser(data) {
  return request({
    url: '/employee/apply/employeeApplyUpdate',
    method: 'post',
    data: data
  })
}

// 修改店员申请 - 状态
export function updateUserStatus(data) {
  return request({
    url: '/employee/apply/updateUserStatus',
    method: 'post',
    data: data
  })
}

// 删除店员申请
export function delUser(userId) {
  return request({
    url: '/employee/apply/' + userId,
    method: 'delete'
  })
}

// 店员申请状态修改
export function changeUserStatus(userId, status) {
  const data = {
    userId,
    status
  }
  return request({
    url: '/employee/apply/employeeApplyChangeStatus',
    method: 'put',
    data: data
  })
}

// 查询店员申请个人信息
export function getUserProfile() {
  return request({
    url: '/employee/apply/profile',
    method: 'get'
  })
}

// 修改店员申请个人信息
export function updateUserProfile(data) {
  return request({
    url: '/employee/apply/profile',
    method: 'put',
    data: data
  })
}

// 店员申请头像上传
export function uploadAvatar(data) {
  return request({
    url: '/employee/apply/profile/avatar',
    method: 'post',
    data: data
  })
}
